package cn.iocoder.yudao.module.dt.dal.mysql.feeitem;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.dt.dal.dataobject.feeitem.FeeItemDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.dt.controller.admin.feeitem.vo.*;

/**
 * 活动价格 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface FeeItemMapper extends BaseMapperX<FeeItemDO> {

    default PageResult<FeeItemDO> selectPage(FeeItemPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<FeeItemDO>()
                .eqIfPresent(FeeItemDO::getTitle, reqVO.getTitle())
                .eqIfPresent(FeeItemDO::getFee, reqVO.getFee())
                .eqIfPresent(FeeItemDO::getMemberFee, reqVO.getMemberFee())
                .eqIfPresent(FeeItemDO::getTeamFee, reqVO.getTeamFee())
                .eqIfPresent(FeeItemDO::getActivityId, reqVO.getActivityId())
                .eqIfPresent(FeeItemDO::getAllCount, reqVO.getAllCount())
                .eqIfPresent(FeeItemDO::getSignCount, reqVO.getSignCount())
                .eqIfPresent(FeeItemDO::getContent, reqVO.getContent())
                .betweenIfPresent(FeeItemDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(FeeItemDO::getId));
    }

    default List<FeeItemDO> selectList(FeeItemExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<FeeItemDO>()
                .eqIfPresent(FeeItemDO::getTitle, reqVO.getTitle())
                .eqIfPresent(FeeItemDO::getFee, reqVO.getFee())
                .eqIfPresent(FeeItemDO::getMemberFee, reqVO.getMemberFee())
                .eqIfPresent(FeeItemDO::getTeamFee, reqVO.getTeamFee())
                .eqIfPresent(FeeItemDO::getActivityId, reqVO.getActivityId())
                .eqIfPresent(FeeItemDO::getAllCount, reqVO.getAllCount())
                .eqIfPresent(FeeItemDO::getSignCount, reqVO.getSignCount())
                .eqIfPresent(FeeItemDO::getContent, reqVO.getContent())
                .betweenIfPresent(FeeItemDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(FeeItemDO::getId));
    }

}
